<%

Function GetBody(ConStr,StartStr,OverStr,IncluL,IncluR)
If ConStr="$False$" or ConStr="" or IsNull(ConStr)=True Or StartStr="" or IsNull(StartStr)=True Or OverStr="" or IsNull(OverStr)=True Then
  GetBody="$False$"
  Exit Function
End If
Dim ConStrTemp
Dim Start,Over
ConStrTemp=Lcase(ConStr)
StartStr=Lcase(StartStr)
OverStr=Lcase(OverStr)
Start = InStrB(1, ConStrTemp, StartStr, vbBinaryCompare)
If Start<=0 then
  GetBody="$False$"
  Exit Function
Else
  If IncluL=False Then
   Start=Start+LenB(StartStr)
  End If
End If
Over=InStrB(Start,ConStrTemp,OverStr,vbBinaryCompare)
If Over<=0 Or Over<=Start then
  GetBody="$False$"
  Exit Function
Else
  If IncluR=True Then
   Over=Over+LenB(OverStr)
  End If
End If
GetBody=MidB(ConStr,Start,Over-Start)
End Function


   Function GET_POST(tar,ref,body)
      Dim returnstr
    'body=Cstr(body)
	Set xml = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
xml.setTimeouts FreeHost_t1, FreeHost_t2, FreeHost_t3, FreeHost_t4
xml.Open "POST", tar, False
xml.setRequestHeader "Content-Length",Len(body)
xml.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
xml.setRequestHeader "REFERER",ref
xml.send body
returnstr = Bytes2bStra(xml.responsebody)
	GET_POST = returnstr
End Function
   Function Bytes2bStra(vin)
      Dim BytesStream,StringReturn
      Set BytesStream = Server.CreateObject("ADODB.Stream")
      BytesStream.Type = 2
      BytesStream.Open
      BytesStream.WriteText vin
      BytesStream.Position = 0
      BytesStream.Charset = "gb2312"
      BytesStream.Position = 2
      StringReturn =BytesStream.ReadText
      BytesStream.close
      Set BytesStream = Nothing
      Bytes2bStra = StringReturn
   End Function
	

   Function getHTTPPage(url) 
	'	on error resume next 
		dim http 
		set http=Server.createobject("MSXML2.XMLHTTP") 
		Http.open "get",url,false 
		Http.send() 
		if Http.readystate<>4 then
			exit function 
		end if 
		getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
		set http=nothing
		if err.number<>0 then err.Clear  
	End function

	Function getHTTPPage(url) 
	'	on error resume next 
		dim http 
		set http=Server.createobject("MSXML2.XMLHTTP") 
		Http.open "get",url,false 
		Http.send() 
		if Http.readystate<>4 then
			exit function 
		end if 
		getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
		set http=nothing
		if err.number<>0 then err.Clear  
	End function
		
	Function BytesToBstr(body,Cset)
		dim objstream
		set objstream = Server.CreateObject("adodb.stream")
		objstream.Type = 1
		objstream.Mode =3
		objstream.Open
		objstream.Write body
		objstream.Position = 0
		objstream.Type = 2
		objstream.Charset = Cset
		BytesToBstr = objstream.ReadText 
		objstream.Close
		set objstream = nothing
	End Function
	
%>